<template>
    <a :href="`${proxy.$setting.globalUrl.fileurl}/${props.sourcedir||props.dir}/${v}`" target="_blank" v-for="(v,i) in props.videos.split(',')" key="v" v-if="props.videos">
        <img :src="`${proxy.$setting.globalUrl.fileurl}/${props.dir}/${props.imgs.split(',')[i]}`" v-if="v!=''" />
    </a>
    <a :href="`${proxy.$setting.globalUrl.fileurl}/${props.sourcedir||props.dir}/${t}`" target="_blank" v-for="t in props.imgs.split(',')" key="t" v-else>
        <img :src="`${proxy.$setting.globalUrl.fileurl}/${props.dir}/${t}`" v-if="t!=''" />
    </a>
</template>

<script setup>
    import { getCurrentInstance } from 'vue'
    let { proxy } = getCurrentInstance()
    const props = defineProps({
        imgs: { type: String, require: true, default:"" },
        videos: { type: String },
        dir: { type: String, require: true},
        sourcedir: { type: String },
    })
</script>

<style scoped lang="scss">
    img { object-fit: cover; max-height: 50px; max-width: 100px; margin-right: 5px; }
</style>